﻿using Basic.FlowGatewayModule.Interface;
using Basic.FlowGatewayModule.Model;
using Basic.FlowRemoteModel.AuditSignFile.Model;
using WeDonekRpc.ApiGateway.Attr;
using WeDonekRpc.Helper.Validate;
using WeDonekRpc.HttpApiGateway;
using WeDonekRpc.HttpApiGateway.Model;

namespace Basic.FlowGatewayModule.Api
{
    [ApiRouteName("/flow/audit/sign/file/{name}")]
    internal class FlowAuditSignFileApi : ApiController
    {
        private readonly IFlowAuditSignFileService _Service;

        public FlowAuditSignFileApi ( IFlowAuditSignFileService service )
        {
            this._Service = service;
        }
        public void Accredit ( [NumValidate("flow.log.id.error", 1)] long logId, [NumValidate("file.id.error", 1)] long fileId )
        {
            this._Service.Accredit(logId, fileId, base.UserState);
        }
        public void AddSignLog ( AuditSignAdd data )
        {
            this._Service.AddSignLog(data, base.UserState.ToEmpId());
        }
        public void SetImgUri ( LongParam<SignImg> param )
        {
            this._Service.SetImgUri(param.Id, param.Value);
        }
        public long Add ( SignFileAdd add )
        {
            return this._Service.Add(add, base.UserState.ToEmpId());
        }

        public void Delete ( [NumValidate("flow.sign.file.id.error", 1)] long id )
        {
            this._Service.Delete(id);
        }

        public AuditSignFile[] Gets ( [NumValidate("flow.log.id.error", 1)] long logId )
        {
            return this._Service.Gets(logId);
        }
    }
}
